<?php 
$offset =0 ;
$commentList = getUserCommentList($_GET["itemid"],$offset,"no");
$commentResult = mysql_fetch_assoc($commentList);
$cTotal = getUserCommentList($_GET["itemid"],$offset,"yes");

?>
<a href="pages/comment_add.php?aj&itemid=<?php echo $_GET['itemid']; ?>" rel="facebox"> Add Comment</a>
Total Comments <strong class="bold redtxt"><?php echo $cTotal; ?></strong>
<div id="commessage"></div>
<div id="data_list">
 <?php if($cTotal>0){ ?>
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable">
    <tr>
      <th width="3%">&nbsp;</th>
      <th width="90%" align="left">Comment</th>
      <th width="7%">&nbsp;</th>
    </tr>
	<?php do { ?>
    <tr>
      <td><span class="dates"><?php echo $commentResult["user_comment_id"];?></span></td>
      <td>
          <a href="pages/comment_details.php?itemid=<?php echo $commentResult["user_comment_id"];?>&aj" rel="facebox"><?php echo $commentResult["user_comment_message"];?> <span class="dates"><?php echo substr($commentResult["comment_date"],0,10);?></span></a>
          <a href="pages/comment_add.php?aj&itemid=<?php echo $_GET['itemid']; ?>&r=<?php echo $commentResult["user_comment_id"];?>" rel="facebox"> Reply</a>
      </td>
      <td>
        <input type="button" name="Button" value="Del" id="comDel<?php echo $commentResult["user_comment_id"];?>" onclick="processCommentDeleteClick('comDel<?php echo $commentResult["user_comment_id"];?>','<?php echo $commentResult["user_comment_id"];?>','com','commessage')"/>
      </td>
    </tr>
	<?php }while($commentResult = mysql_fetch_assoc($commentList));?>
  </table>
<?php } ?>
</div>
